<div>

    <h2 translate="sakuraApp.shopCategory.home.title">ShopCategory</h2>

    <div class="container">
        <div class="row">
            <div class="col-md-4">
                <button class="btn btn-primary" data-toggle="modal" data-target="#saveShopCategoryModal" ng-click="clear()">
                    <span class="glyphicon glyphicon-flash"></span> <span translate="sakuraApp.shopCategory.home.createLabel">Create a new ShopCategory</span>
                </button>
            </div>
            <div class="col-md-8">
                <form name="searchForm" class="form-inline">
                    <div class="form-group">
                        <input type="text" class="form-control" ng-model="searchQuery" id="searchQuery" placeholder="query">
                    </div>
                    <button class="btn btn-info" ng-click="search()"><span class="glyphicon glyphicon-search"></span> <span>Search a ShopCategory</span>
                    </button>
                </form>
            </div>
        </div>
    </div>

    <div class="modal fade" id="saveShopCategoryModal" tabindex="-1" role="dialog" aria-labelledby="myShopCategoryLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <form name="editForm" role="form" novalidate ng-submit="save()" show-validation>

                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
                                ng-click="clear()">&times;</button>
                        <h4 class="modal-title" id="myShopCategoryLabel" translate="sakuraApp.shopCategory.home.createOrEditLabel">Create or edit a ShopCategory</h4>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <label>ID</label>
                            <input type="text" class="form-control" name="id"
                                   ng-model="shopCategory.id" readonly>
                        </div>

                        <div class="form-group">
                            <label translate="sakuraApp.shopCategory.name">Name</label>
                            <input type="text" class="form-control" name="name"
                                   ng-model="shopCategory.name" required ng-maxlength="20">

                            <div ng-show="editForm.name.$invalid">
                                <p class="help-block"
                                   ng-show="editForm.name.$error.required" translate="entity.validation.required">
                                    This field is required.
                                </p>
                                <p class="help-block"
                                   ng-show="editForm.name.$error.maxlength" translate="entity.validation.maxlength" translate-value-max="20">
                                    This field cannot be longer than 20 characters.
                                </p>
                            </div>
                        </div>
                        <div class="form-group">
                            <label translate="sakuraApp.shopCategory.disabled">Disabled</label>
                            <input type="checkbox" class="form-control" name="disabled"
                                   ng-model="shopCategory.disabled">

                        </div>

                        <div class="form-group">
                            <label translate="sakuraApp.shopCategory.parent">parent</label>
                            <select class="form-control" name="parent" ng-model="shopCategory.parent.id" ng-options="shopCategory.id as shopCategory.name for shopCategory in shopcategorys">
                            </select>
                        </div>
                        <div class="form-group">
                            <label translate="sakuraApp.shopCategory.shop">shop</label>
                            <select class="form-control" name="shop" ng-model="shopCategory.shop.id" ng-options="shop.id as shop.shop for shop in shops">
                            </select>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="clear()">
                            <span class="glyphicon glyphicon-ban-circle"></span>&nbsp;<span translate="entity.action.cancel">Cancel</span>
                        </button>
                        <button type="submit" ng-disabled="editForm.$invalid" class="btn btn-primary">
                            <span class="glyphicon glyphicon-save"></span>&nbsp;<span translate="entity.action.save">Save</span>
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="modal fade" id="deleteShopCategoryConfirmation">
        <div class="modal-dialog">
            <div class="modal-content">
                <form name="deleteForm" ng-submit="confirmDelete(shopCategory.id)">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
                                ng-click="clear()">&times;</button>
                        <h4 class="modal-title" translate="entity.delete.title">Confirm delete operation</h4>
                    </div>
                    <div class="modal-body">
                        <p translate="sakuraApp.shopCategory.delete.question" translate-values="{id: '{{shopCategory.id}}'}">Are you sure you want to delete this ShopCategory?</p>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="clear()">
                            <span class="glyphicon glyphicon-ban-circle"></span>&nbsp;<span translate="entity.action.cancel">Cancel</span>
                        </button>
                        <button type="submit" ng-disabled="deleteForm.$invalid" class="btn btn-danger">
                            <span class="glyphicon glyphicon-remove-circle"></span>&nbsp;<span translate="entity.action.delete">Delete</span>
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="table-responsive">
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>ID</th>
                    <th translate="sakuraApp.shopCategory.name">Name</th>
                    <th translate="sakuraApp.shopCategory.disabled">Disabled</th>
                    <th translate="sakuraApp.shopCategory.parent">parent</th>
                    <th translate="sakuraApp.shopCategory.shop">shop</th>
                    <th></th>
                </tr>
            </thead>
            <tbody infinite-scroll="loadPage(page + 1)" infinite-scroll-disabled="links['last'] == page">
                <tr ng-repeat="shopCategory in shopCategorys">
                    <td><a ui-sref="shopCategoryDetail({id:shopCategory.id})">{{shopCategory.id}}</a></td>
                    <td>{{shopCategory.name}}</td>
                    <td>{{shopCategory.disabled}}</td>
                    <td>{{shopCategory.parent.name}}</td>
                    <td>{{shopCategory.shop.shop}}</td>
                    <td>
                        <button type="submit"
                                ui-sref="shopCategoryDetail({id:shopCategory.id})"
                                class="btn btn-info btn-sm">
                            <span class="glyphicon glyphicon-eye-open"></span>&nbsp;<span translate="entity.action.view"> View</span>
                        </button>
                        <button type="submit"
                                ng-click="showUpdate(shopCategory.id)"
                                class="btn btn-primary btn-sm">
                            <span class="glyphicon glyphicon-pencil"></span>&nbsp;<span translate="entity.action.edit"> Edit</span>
                        </button>
                        <button type="submit"
                                ng-click="delete(shopCategory.id)"
                                class="btn btn-danger btn-sm">
                            <span class="glyphicon glyphicon-remove-circle"></span>&nbsp;<span translate="entity.action.delete"> Delete</span>
                        </button>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
